package com.qtt.app.mapper;

import com.qtt.app.entity.OrderForm;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository   //需要写
public interface OrderFormMapper {
    int deleteByPrimaryKey(String id);

    int insert(OrderForm record);

    int insertSelective(OrderForm record);

    OrderForm selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(OrderForm record);

    int updateByPrimaryKey(OrderForm record);

    @Select("SELECT * FROM order_form")
    List<OrderForm> list();

//    @Select("SELECT * FROM order_form WHERE user_id=#{userId} AND status = #{orderState}")
    List<OrderForm> getOrderByIdAndState(@Param("userId") Long userId, @Param("orderState")Integer orderState);

//    @Select("SELECT * FROM order_form WHERE user_id=#{userId}")
    List<OrderForm> getOrderByUserId(@Param("userId") Long userId);
}